﻿using System;
using UnityEngine;

// Token: 0x0200000B RID: 11
public class CustomLoad : MonoBehaviour
{
	// Token: 0x06000031 RID: 49 RVA: 0x00007344 File Offset: 0x00005544
	private void Update()
	{
		this.checkTime -= Time.deltaTime;
		if (this.checkTime < 0f)
		{
			this.checkTime = 0.5f;
			if (GameManager.main.playerBody.torso.transform.position.x > this.minDistance)
			{
				this.wentBeyondLimit = true;
			}
			if (this.wentBeyondLimit && !GameManager.main.playerBody.alive)
			{
				GameManager.main.sceneLoadTarget = this.targetScene;
				GameManager.main.fadingOut = true;
			}
		}
	}

	// Token: 0x040000AF RID: 175
	public string targetScene;

	// Token: 0x040000B0 RID: 176
	public float minDistance;

	// Token: 0x040000B1 RID: 177
	private float checkTime;

	// Token: 0x040000B2 RID: 178
	private bool wentBeyondLimit;
}
